{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "bd64fd27",
   "metadata": {},
   "outputs": [],
   "source": [
    "phrase = \"Dont't panic!\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "737fc184",
   "metadata": {},
   "outputs": [],
   "source": [
    "plist = list (phrase)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "7dd03cc0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dont't panic!\n"
     ]
    }
   ],
   "source": [
    "print(phrase)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "2d1824f0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['D', 'o', 'n', 't', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n"
     ]
    }
   ],
   "source": [
    "print(plist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "17182a8c",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "list.remove(x): x not in list",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "Input \u001b[1;32mIn [15]\u001b[0m, in \u001b[0;36m<cell line: 3>\u001b[1;34m()\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m4\u001b[39m):\n\u001b[0;32m      2\u001b[0m         plist\u001b[38;5;241m.\u001b[39mpop()\n\u001b[1;32m----> 3\u001b[0m \u001b[43mplist\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mremove\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m      4\u001b[0m plist\u001b[38;5;241m.\u001b[39mextend([plist\u001b[38;5;241m.\u001b[39mpop(),plist\u001b[38;5;241m.\u001b[39mpop()])\n\u001b[0;32m      5\u001b[0m plist\u001b[38;5;241m.\u001b[39minsert(\u001b[38;5;241m2\u001b[39m,plist\u001b[38;5;241m.\u001b[39mpop(\u001b[38;5;241m3\u001b[39m))\n",
      "\u001b[1;31mValueError\u001b[0m: list.remove(x): x not in list"
     ]
    }
   ],
   "source": [
    "for i in range(4):\n",
    "        plist.pop()\n",
    "plist.remove(\"'\")\n",
    "plist.extend([plist.pop(),plist.pop()])\n",
    "plist.insert(2,plist.pop(3))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "58cb0d27",
   "metadata": {},
   "outputs": [],
   "source": [
    "new_phrase = ''.join(plist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "516b0392",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['D', 'o', 't', 'n', 't', ' ', 'a', 'p']\n"
     ]
    }
   ],
   "source": [
    "print(plist)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "37e51fe9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Dotnt ap\n"
     ]
    }
   ],
   "source": [
    "print(new_phrase)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "34f23f10",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
